-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue SDK: stop passing down unused props #3891
base: main
Are you sure you want to change the base?
Conversation
|
View your CI Pipeline Execution ↗ for commit 157e72f.
☁️ Nx Cloud last updated this comment at |
'attributes: this.attributes,', | ||
'...(this.hasAttributesInput(this.Wrapper) ? { attributes: this.attributes } : {})' | ||
'attributes: this.wrappedPropsWithAttributes.attributes,', | ||
'...(this.hasAttributesInput(this.Wrapper) ? { attributes: this.wrappedPropsWithAttributes.attributes } : {})' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidmohanty11 I think I'm breaking this code with this PR. My change here is fine but the ngOnChanges
overrides below in this same plugin will stop working:
ngOnChanges(changes: SimpleChanges) { if (changes["attributes"] && !this.hasAttributesInput(this.Wrapper)) { this.ngAfterViewInit(); }
what do you suggest we do about this? Also, is there anything else that will start to break with this approach?
if it's too hard to make the angular SDK happy with not having an attributes
prop, i can look into bringing it back in this plugin instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samijaber breaking up attributes will mean that we'll lose access to builder-id, style etc so now we'll have to attach all props as HTML attributes and not pass them to be reactive (as inputs). Is it possible to keep the attributes key? because here:
builder/packages/sdks/mitosis.config.cjs
Lines 723 to 731 in f9b8552
ngAfterViewInit() { | |
if (!this.hasAttributesInput(this.Wrapper)) { | |
const wrapperElement = | |
this.wrapperTemplateRef.elementRef.nativeElement?.nextElementSibling; | |
if (wrapperElement) { | |
this.updateAttributes(wrapperElement, this.attributes); | |
} | |
} | |
} |
we check if that element doesn't have
attributes
as an input then we spread it out in the element
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else we can look for only these four: id, style, href and className as attributes and send everything else as inputs
Description
https://builder-io.atlassian.net/browse/ENG-7615